tools/ocaml/xb: Add BoundedQueue
authorEdwin Török <edvin.torok@citrix.com>
Wed, 12 Oct 2022 18:13:03 +0000 (19:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Nov 2022 14:07:24 +0000 (14:07 +0000)
commitea1567893b05df03fe65657f0a25211a6a9ff7ec
tree8fc66771e1338db03b8a3f20bcc3f3b9529ca309
parent59981b08c8ef6eed37b1171656c2a5f3b4b74012
tools/ocaml/xb: Add BoundedQueue

Ensures we cannot store more than [capacity] elements in a [Queue].  Replacing
all Queue with this module will then ensure at compile time that all Queues
are correctly bound checked.

Each element in the queue has a class with its own limits.  This, in a
subsequent change, will ensure that command responses can proceed during a
flood of watch events.

No functional change.

This is part of XSA-326.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
(cherry picked from commit 19171fb5d888b4467a7073e8febc5e05540956e9)
tools/ocaml/libs/xb/xb.ml